-- GET_MECHANIC_SPIDER_DESC

-- 获取机械蜘蛛的描述
return function()
    local ret = {};

    -- 找蜘蛛
    local summon;
    local list = ME.user.dbase:query("summon") or {};
    for pos, data in pairs(list) do
        local classId = data["class_id"];
        local rule = SummonM.query(classId, "rule");
        if rule and rule == "mechanic_spider" then
            summon = DungeonM.getGridByPos(pos).summon;
            break;
        end
    end

    if not summon then
        return ret;
    end

    -- 每X轮攻击
    local name = getLocStr("spider_skill_name");
    local round = SummonM.calcPhysicCd(summon);
    local desc = string.format(getLocStr("spider_skill_desc"), round);
    table.insert(ret, {["name"] = name, ["desc"] = desc});


    -- 主动技
    local skills = SummonM.getAllSkills(summon) or {};
    for _, skillId in pairs(skills) do
        name = SkillM.query(skillId, "name");
        name = name .. getLocStr("active_cast");
        desc = extractString(SkillM.getSkillDesc(skillId, nil, nil, {["source"] = summon}));
        -- 显示魔法值消耗
        local costMp = SkillM.query(skillId, "dbase").cost_mp or 0;
        desc = desc .. string.format(getLocStr("cost_mp"), costMp);

        table.insert(ret, {["name"] = name, ["desc"] = desc});
    end

    return ret;
end
